package com.epta.service;

import com.epta.mapper.UserMapper;
import com.epta.pojo.User;
import com.epta.common.util.DateTimeUtil;
import com.epta.vo.UserBackListVo;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/6/19 0019.
 */
@Service
public class UserService extends BaseService<User> {

    @Autowired
    private UserMapper userMapper;



    public User login(String name, String password){
        User user = new User();
        user.setName(name);
        user.setPassword(password);
        return this.queryOne(user);
    }

    /**
     * 新增用户，将密码设为空后返回
     * @param user
     * @return
     */
    public User add(User user){
        this.save(user);
        user.setPassword(null);
        return user;
    }

}
